{include file='common/head.html'}
<div class="layui-body">
    <div class="bg-default">
        {if(![$dbsecurity]||![$session.pwsecurity])}
        {if(![$dbsecurity])}
        <div class="ant-alert ant-alert-info">
            <i class="fa fa-info-circle anticon ant-alert-icon" aria-hidden="true"></i><span class="ant-alert-message">您的数据库文件存在安全隐患，可能被下载，请尽快修改数据库路径！ <a href="{url./admin/Index/home}&action=moddb">自动修改</a></span>
        </div>
        {/if}
        {if(![$session.pwsecurity])}
        <div class="ant-alert ant-alert-info">
            <i class="fa fa-info-circle anticon ant-alert-icon" aria-hidden="true"></i><span class="ant-alert-message">您的账号密码为初始密码，存在安全隐患，请尽快修改密码！ <a href="{url./admin/Index/ucenter}">立即修改</a></span>
        </div>
        {/if}
        {/if}
        {if([$debug] && session('ucode')==10001)}
        <div class="ant-alert ant-alert-info">
            <i class="fa fa-info-circle anticon ant-alert-icon" aria-hidden="true"></i><span class="ant-alert-message">网站上线之后请将 Debug 状态改为关闭，屏蔽报错，增强安全性！ <a href="{url./admin/Config/index}">立即修改</a></span>
        </div>
        {/if}
        <blockquote class="layui-elem-quote">
            当前登录用户：{$user_info->username} {$user_info->realname}，登录时间：{$user_info->update_time}，登录IP：{fun=long2ip([$user_info->last_login_ip])}，累计登录次数：{$user_info->login_count}
        </blockquote>
        <div class="layui-row" style="margin:0 -5px">
            {foreach $model_msg(key,value)}
            {if($value->mcode==1)}
            <div class="layui-col-xs6 layui-col-sm4 layui-col-md2 layui-col-lg2">
                <dl class="deskbox center-block">
                    <dt>[value->name]总数</dt>
                    <dd>[value->count]</dd>
                </dl>
            </div>
            {/if}
            {if($value->mcode==2)}
            <div class="layui-col-xs6 layui-col-sm4 layui-col-md2 layui-col-lg2">
                <dl class="deskbox center-block">
                    <dt>[value->name]总数</dt>
                    <dd>[value->count]</dd>
                </dl>
            </div>
            {/if}
            {if($value->mcode==3)}
            <div class="layui-col-xs6 layui-col-sm4 layui-col-md2 layui-col-lg2">
                <dl class="deskbox center-block">
                    <dt>[value->name]总数</dt>
                    <dd>[value->count]</dd>
                </dl>
            </div>
            {/if}
            {if(![$message_status] && $value->mcode!=1 && $value->mcode!=2 && $value->mcode!=3)}
            <div class="layui-col-xs6 layui-col-sm4 layui-col-md2 layui-col-lg2">
                <dl class="deskbox center-block">
                    <dt>[value->name]总数</dt>
                    <dd>[value->count]</dd>
                </dl>
            </div>
            {/if}
            {/foreach}
            {if([$message_status])}
            <div class="layui-col-xs6 layui-col-sm4 layui-col-md2 layui-col-lg2">
                <a href="{url./admin/Message/index}">
                    <dl class="deskbox center-block">
                        <dt>询盘总数</dt>
                        <dd>{$sum_msg}</dd>
                    </dl>
                </a>
            </div>
            <div class="layui-col-xs6 layui-col-sm4 layui-col-md2 layui-col-lg2">
                <a href="{url./admin/Message/index}&view_status=2">
                    <dl class="deskbox center-block">
                        <dt>未审询盘</dt>
                        <dd>{$sum_msg_2}</dd>
                    </dl>
                </a>
            </div>
            <div class="layui-col-xs6 layui-col-sm4 layui-col-md2 layui-col-lg2">
                <a href="{url./admin/Message/index}&view_status=1">
                    <dl class="deskbox center-block">
                        <dt>已审询盘</dt>
                        <dd>{$sum_msg_1}</dd>
                    </dl>
                </a>
            </div>
            {/if}
        </div>
        <div class="layui-row layui-col-space10">
            <div class="layui-col-xs12 layui-col-md6">
                <table class="layui-table table-two">
                    <thead>
                        <tr>
                            <th colspan="2">服务器环境</th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr>
                            <th>站点域名</th>
                            <td>{$server->server_name}</td>
                        </tr>
                        <tr>
                            <th>运行环境</th>
                            <td>{$server->php_os} {$server->server_software}</td>
                        </tr>
                        <tr>
                            <th>服务器IP</th>
                            <td>{$server->server_addr}:{$server->server_port}</td>
                        </tr>
                       
                        <tr>
                            <th>PHP版</th>
                            <td>{$server->php_version}</td>
                        </tr>
                        <tr>
                            <th>数据库驱动</th>
                            <td>{$server->db_driver}</td>
                        </tr>
                        <tr>
                            <th>文件上传限制</th>
                            <td>{$server->upload_max_filesize}</td>
                        </tr>
                        <tr>
                            <th>表单提交限制</th>
                            <td>{$server->post_max_size}</td>
                        </tr>
                    </tbody>
                </table>
            </div>
            {if([$debug] && session('ucode')==10001)}
            <div class="layui-col-xs12 layui-col-md6">
                <table class="layui-table table-two">
                    <thead>
                        <tr>
                            <th colspan="3">登录日志<span style="font-weight: normal;font-size: 12px;color: #999;">（超级管理员可见全部登录日志，其他管理员只可见自己账号）</span></th>
                            <th colspan="1"><a href="{url./admin/Loginlog/index}" style="color: #666;font-weight: normal;">更多>></a></th>
                        </tr>
                    </thead>
                    <tbody>
                        {foreach $log_login_msg(key,value)}
                        {if($key < 7)}
                        <tr>
                            <td>[value->create_user]</td>
                            <td>[value->event]</td>
                            <td width=140>IP: <a href="http://ip.taobao.com/ipSearch.html?ipAddr={fun=long2ip($value->user_ip)}" target="_blank" title="点击查看归属地">{fun=long2ip($value->user_ip)}</a></td>
                            <td width=140>[value->create_time]</td>
                        </tr>
                        {/if}
                        {/foreach}
                    </tbody>
                </table>
            </div>
            {else}
            <div class="layui-col-xs12 layui-col-md6">
                <table class="layui-table table-two">
                    <thead>
                        <tr>
                            <th colspan="3">登录日志</th>
                            <th colspan="1"><span style="font-weight: normal;font-size: 12px;color: #999;">最近7条记录</span></th>
                        </tr>
                    </thead>
                    <tbody>
                        {foreach $log_login_only_msg(key,value)}
                        <tr>
                            <td>[value->create_user]</td>
                            <td>[value->event]</td>
                            <td width=140>IP: <a href="http://ip.taobao.com/ipSearch.html?ipAddr={fun=long2ip($value->user_ip)}" target="_blank" title="点击查看归属地">{fun=long2ip($value->user_ip)}</a></td>
                            <td width=140>[value->create_time]</td>
                        </tr>
                        {/foreach}
                    </tbody>
                </table>
            </div>
            {/if}
        </div>
    </div>
    {if([$cmsinfo] && session('ucode')==10001 && ![$copyright])}
    <div class="powered">
        Powered by <a href="https://www.pbmod.cn/" target="_blank">PBMOD</a> V{APP_VERSION}-{RELEASE_TIME}
    </div>
    {else}
    <div class="powered">
        {$copyright}
    </div>
    {/if}
</div>
{include file='common/foot.html'}